#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void delete(int arr[],int x,int del)
{
	int i = 0;
	for (i = 0; i < x; i++)
	{
		if (arr[i] != del)
			printf("%d ", arr[i]);
	}
}

int main()
{
	int arr[50] = { 0 };
	int N = 0;
	scanf("%d", &N);
	int i = 0;
	for (i = 0; i < N; i++)
		scanf("%d", &arr[i]);
	int del = 0;
	scanf("%d", &del);
	delete(arr, N,del);
	return 0;
}